home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 18
/
018.d81
/
awg adsr toy
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
2KB
|
78 lines
10 rem graphic adsr stuff
15 ifx=0then gosub60000
20 ifx=0thenx=1:load"sysplotterd.o",8,1
22 print" press a key to continue"
24 poke198,0:wait198,1:geta$
25 poke650,255
30 :
35 sid=54272:hf=40:lf=100:vol=15
40 gr=49152:ng=49155:cl=49158:sm=49161
41 co=49164
42 line=49173:unl=49176:text=49179
95 :
100 sysgr:syscl:syssm,1:sysco,0
110 a=8:d=8:s=8:r=8:gosub400:goto293
120 :
200 sysline,0,200,ax,ay
210 sysline,ax,ay,dx,dy
220 sysline,dx,dy,sx,sy
230 sysline,sx,sy,rx,ry
240 :
242 s1=bx:s2=by:s3=ax:s4=ay
244 s5=dx:s6=dy:s7=sx:s8=sy
246 s9=rx:en=ry
248 :
250 poke198,0:wait198,1:geta$
251 ifa$="q"then63000
252 ifa$="p"thengosub600:goto250
260 ifa$="a"thena=a+1:ifa=16thena=0
263 gosub400
270 ifa$="d"thend=d+1:ifd=16thend=0
273 gosub400
280 ifa$="s"thens=s+1:ifs=16thens=0
283 gosub400
290 ifa$="r"thenr=r+1:ifr=16thenr=0
292 gosub400:syscl
293 t$="attack"+str$(a)+" "+"decay"+str$(d):systext,t$,0,0
294 t$="sustain"+str$(s)+" release"+str$(r):systext,t$,0,9
295 :
296 sysun,0,200,s3,s4:sysun,s3,s4,s5,s6: sysun,s5,s6,s7,s8
297 sysun,s7,s8,s9,en
300 goto200
350 :
400 ax=a*5:ay=100
402 dx=ax+d*5:sy=100+(15-s)*3:dy=sy
404 sx=dx+40
406 rx=sx+r*5:ry=200
410 return
600 forx=sidtosid+23:pokex,0:next
602 pokesid+24,vol:poke53280,2
604 pokesid+5,a*16+d:pokesid+6,s*16+r
606 pokesid,lf:pokesid+1,hf:pokesid+4,33
608 fordl=1to300:ifpeek(198)=0thennext
609 poke198,0
610 pokesid+4,32:poke53280,6
612 return
60000 rem title and instructions
60002 poke53281,1
60010 print"[147][144]"chr$(142):printspc(10)"** awg adsr tool **"
60020 print" (a) ==> changes attack"
60022 print" (d) ==> changes decay"
60024 print" (s) ==> changes sustain"
60026 print" (r) ==> changes release"
60028 print" (p) ==> plays current envelope"
60030 print" (q) ==> quit--returns to loadstar"
60040 print" values will change from 0 to 15 and"
60042 print" then back to zero (wrap around)."
60050 return
63000 rem quit
63010 sysng:print"[147]"
63020 print"[196]o you really want to quit? ";
63030 poke198,0:wait198,1:geta$
63035 ifa$<>"y"anda$<>"n"then63030
63040 printa$
63050 ifa$="n"thenprint"[147]":goto100
63060 :
63070 load"hello connect",8
63080 end